1. /* srfrsdiv.cpp by K.Tsuru */
  2. // function ID = 815 BRADIX
  3. /*****************
  4. SRational class
  5. x/n = x.num/(x.den*n)
  6. ******************/
  7. #ifndef SN_H
  8. #include "sn.h"
  9. #endif
  10. SRational RsDiv(const SRational& x, ulong n){
  11. if(n == 1uL) return x;
  12. if(n == 0) x.num.SetError(x.num.DIVIDED_BY_ZERO,"RsDiv", 815);
  13. SRational r; // r.reduceDone = false;
  14. r.num = x.num;
  15. if(n <= r.den.SlOpMaxValue()) IsMult(x.den, n, r.den);
  16. else r.den = x.den*(SInteger)n;
  17. r.reduce(false);
  18. return r;
  19. }

srfrsdiv.cpp : last modifiled at 2016/06/26 16:28:03(508 bytes)
created at 2016/06/26 15:57:35
The creation time of this html file is 2016/09/18 20:28:05 (Sun Sep 18 20:28:05 2016).